<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ProjectFileList.aspx.cs" Inherits="Admin_ProjectFileList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Choose a Project File</title>
</head>
<body>
    <form id="form1" runat="server">
     <h4>
        Select File</h4>
    <br />
    <table border="0" cellpadding="0" cellspacing="0" style="width: 100%; height: 100%">
        <tr>
            <td align="center" style="width: 100px" valign="top">
                <table border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td align="center" colspan="2" style="width: 100px">
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
        DataKeyNames="FileID" DataSourceID="ObjectDataSource1">
        <Columns>
            <asp:TemplateField HeaderText="Select">
                <ItemTemplate>
                    <input id="Button1" type="button" value="Select" onclick="window.opener.document.forms[0].elements['ctl00_Main_hfiFileID'].value =<%# Eval("FileID") %>;window.opener.document.forms[0].elements['ctl00_Main_tboFile'].value ='<%# Eval("Name").ToString() %>';window.close();" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="Name" HeaderText="Name" ReadOnly="True" SortExpression="Name" />
            <asp:TemplateField HeaderText="Notes" SortExpression="Notes" Visible="False">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Height="118px" Text='<%# Bind("Notes") %>'
                        TextMode="MultiLine" Width="397px"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("Notes") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:CheckBoxField DataField="IsPublic" HeaderText="IsPublic" SortExpression="IsPublic" />
            <asp:TemplateField HeaderText="Version" SortExpression="Version">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Version") %>' Width="81px"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("Version") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="Extention" HeaderText="Extention" ReadOnly="True" SortExpression="Extention" />
            <asp:BoundField DataField="Location" HeaderText="Location" ReadOnly="True" SortExpression="Location" Visible="False" />
            <asp:BoundField DataField="Date" HeaderText="Date" ReadOnly="True" SortExpression="Date" Visible="False" />
            <asp:BoundField DataField="FileID" HeaderText="FileID" ReadOnly="True" SortExpression="FileID" />
        </Columns>
        <EmptyDataTemplate>
            There are currently no files.
        </EmptyDataTemplate>
    </asp:GridView>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    &nbsp; &nbsp;<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="RemoveFile"
        InsertMethod="AddFile" SelectMethod="GetFiles" TypeName="FileManager" UpdateMethod="EditFile">
        <DeleteParameters>
            <asp:Parameter Name="FileID" Type="Int32" />
            <asp:Parameter Name="Location" Type="String" />
            <asp:Parameter Name="Name" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Name" Type="String" />
            <asp:Parameter Name="Location" Type="String" />
            <asp:Parameter Name="Notes" Type="String" />
            <asp:Parameter Name="Extention" Type="String" />
            <asp:Parameter Name="Version" Type="String" />
            <asp:Parameter Name="IsPublic" Type="Boolean" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="FileID" Type="Int32" />
            <asp:Parameter Name="Name" Type="String" />
            <asp:Parameter Name="Location" Type="String" />
            <asp:Parameter Name="Date" Type="String" />
            <asp:Parameter Name="Notes" Type="String" />
            <asp:Parameter Name="Extention" Type="String" />
            <asp:Parameter Name="Version" Type="String" />
            <asp:Parameter Name="IsPublic" Type="Boolean" />
        </UpdateParameters>
    </asp:ObjectDataSource>   
    </form>
</body>
</html>
